home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2931 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.4 KB  |  61 lines

  1. Path: newsfeed.direct.ca!usenet
  2. From: qjackson@direct.ca
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: class declaration question
  5. Date: Sat, 20 Jan 1996 18:02:09 GMT
  6. Organization: Parsepolis Software
  7. Message-ID: <4drakm$hnu@grid.direct.ca>
  8. References: <4dphp6$1bp@noc2.drexel.edu>
  9. Reply-To: qjackson@direct.ca
  10. NNTP-Posting-Host: 204.174.249.135
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. st918h5w@dunx1.ocs.drexel.edu (Jonathan Juniman) wrote:
  14.  
  15. >Is it necessary to do this:
  16.  
  17. >class SomeClass
  18. >    {
  19. >    public:
  20. >    void Somefunction(int SomeParameter);
  21. >    }
  22.  
  23. >or is it just as legal to do this:
  24. >class SomeClass
  25. >    {
  26. >    public:
  27. >    void SomeFunction(int);
  28. >    }
  29.  
  30. >The latter seems to be the convention, but why does the compiler need to
  31. >know the name of SomeFunction's argument?  Isn't it sufficient to know the
  32. >type of Somefunction's argument (namely, int)?  
  33.  
  34. The following will compile under Turbo C++ 3.00 -- I don't know what
  35. the standard is --
  36.  
  37. class foo
  38. {
  39.     public:
  40.     void bar (int);
  41. };
  42.  
  43. void foo::bar (int baz)
  44. {
  45.     // do someFoobar
  46.     ++baz;
  47. }
  48.  
  49. void main (void)
  50. {
  51.     foo Chocolate;
  52.     Chocolate.bar(10);
  53. }
  54.  
  55. --      \|/                              O      |
  56.        --+--    Parsepolis Software     -*-   --|-- Quinn Tyler Jackson
  57.         /|\         "Parse City"        /^\     |     (aka 'Jamshid')
  58. >-----------------------------------------------|   qjackson@direct.ca
  59.        Ask me about Laleh's Pattern Matcher...  |--------------------->
  60.  
  61.